import Koa from "koa";
import * as _ from "lodash";

export abstract class youngCore {
  protected ctx;
  protected app;
  protected query;
  protected body;
  protected orm;

  constructor(ctx: any) {
    if (ctx) {
      if (ctx instanceof Koa) {
        this.app = ctx;
      } else {
        this.ctx = ctx;
        this.app = ctx.app;
        this.query = _.cloneDeep(ctx.request.query);
        this.body = _.cloneDeep(ctx.request.body);
      }
    }
  }
}
